package comc.config;

import com.anhua.Util.EnableHelloService;
import com.anhua.Util.HelloService;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
@EnableHelloService
public class EnableTestBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(EnableTestBootstrap.class)
                .web(WebApplicationType.NONE)
                .run(args);
        // 验证test bean是否存在
        HelloService helloService = (HelloService) context.getBean("HelloService");

        System.out.println("bean是否存在--->"+helloService.sayHello());

    }
}
